package model

import "github.com/zeromicro/go-zero/core/stores/sqlx"

var _ UserFoodModel = (*customUserFoodModel)(nil)

type (
	// UserFoodModel is an interface to be customized, add more methods here,
	// and implement the added methods in customUserFoodModel.
	UserFoodModel interface {
		userFoodModel
		withSession(session sqlx.Session) UserFoodModel
	}

	customUserFoodModel struct {
		*defaultUserFoodModel
	}
)

// NewUserFoodModel returns a model for the database table.
func NewUserFoodModel(conn sqlx.SqlConn) UserFoodModel {
	return &customUserFoodModel{
		defaultUserFoodModel: newUserFoodModel(conn),
	}
}

func (m *customUserFoodModel) withSession(session sqlx.Session) UserFoodModel {
	return NewUserFoodModel(sqlx.NewSqlConnFromSession(session))
}
